<%@include file="/WEB-INF/common/taglibs.jsp"%>



<script>
	$(document)
			.ready(
					function() {

						<c:if test="${entity.id ne null}">

						<c:forEach  var="attribute" items="${entity.attributes}">
						$("input[name='attributeIds'][value=${attribute.id}]")
								.attr('checked', 'checked').uniform();
						</c:forEach>
						</c:if>

					});
</script>
<div class="row-fluid">

	<div class="span12">

		<div class="page-header">
			<h4>Product Compare </h4>
		</div>

<form class="form-horizontal seperator" method="post">
<!--name --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="name">Name :</label><input class="span4" id="name" name="name"   type="text" value="${entity.name}" /></div></div></div>

<!--category --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3">Category :</label><div class="span4 controls"><select name="categoryId"><c:if test="${not empty categories}"><c:forEach var="single" items="${categories}"><option value="${single.id}"${(single.id == entity.category.id)?'selected':'' }>${single.name}</option></c:forEach></c:if></select></div></div></div></div>



				<c:forEach items="${attributeGroups}" var="attributeGroup">
				<c:set var="row" value="${row + 1}"/>
					<c:if test="${row % 2 == 1 }">	<div class="row-fluid"> </c:if>
					<div class="span6">
						<div class="todo">
							<h4>${attributeGroup.name}
								Attribute Group <a href="#" class="icon tip" title=""></a>
							</h4>
							<ul>

								<c:forEach items="${attributeGroup.attributes}" var="attribute">
									<li class="clearfix">
										<div class="txt">${attribute.name}</div>
										<div class="controls">
											<input name="attributeIds" type="checkbox"
												value="${attribute.id}"/>
										</div>
									</li>
								</c:forEach>
							</ul>
						</div>
					</div>
				<c:if test="${row % 2 == 0 }"> </div> </c:if>

				</c:forEach>
				<c:set var="row" value="${row + 1}"/>
				<c:if test="${row % 2 == 1 }">	<div class="row-fluid"> </c:if>
	 
</div>



 <div class="form-row row-fluid">
				<div class="span12">
					<div class="row-fluid">
						<div class="form-actions">
							<div class="span3"></div>
							<div class="span4 controls">
								<button type="submit" class="btn btn-info marginR10">Save
									changes</button>
								<button class="btn btn-danger">Cancel</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</form>

	</div>
	<!-- End .span12 -->

</div>
<!-- End .row-fluid --> 

